﻿using Mapster;
using SHZY.BaseData.Entitys.Common.Dto.Material;
using SHZY.BaseData.Entitys.Common.Entity;
using SHZY.Common.Models;
using SHZY.Common.Security;

namespace SHZY.BaseData.Entitys.Common.Mapper.Material;

public class Mapper : IRegister
{
    public void Register(TypeAdapterConfig config)
    {
        config.ForType<ComBaseMaterialCrInput, ComBaseMaterialEntity>()
            .Map(dest => dest.FileInfo, src => src.fileInfo.ToJsonString());
        config.ForType<ComBaseMaterialEntity, ComBaseMaterialInfoOutput>()
            .Map(dest => dest.fileInfo, src => src.FileInfo.ToObject<List<FileControlsModel>>());
    }
}